package hcn.protocol.ods.newdiagnosis;

import lombok.*;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author: zhusm@bsoft.com.cn
 *
 * @Description: 获取待支付列表（JSON）
 *
 * @Create: 2019-04-17 14:03
 **/
@NoArgsConstructor
@Data
@Builder
@AllArgsConstructor
@ToString
public class NewGetUnPayListRequestBean implements Serializable {
    private static final long serialVersionUID = -2216709527895614938L;

    /**
     * hospitalCode : 医院代码
     * beginDate : 起始日期
     * endDate : 结束日期
     * outpatientType : 门诊类型(1-普通2-云门诊普通)
     * patientIdentityCardlist : 证件集合
     * patientMedicalCardList : 诊疗卡集合
     * patientCodelist : 患者在 his 中的唯一标识集合
     */

    private String organizationId;
    private String beginTime;
    private String endTime;
    private int outpatientType;
    private int queryType;//查询类型，参数设置，1表示按患者患者标识集合查询；2表示按证件集合查询；3表示按诊疗卡集合查询；默认是1
    private List<CertificatesBean> patientIdentityCardList;
    private List<CardsBean> patientMedicalCardList;
    private List<PatientCode> patientIdList;

    public void addCertificate(CertificatesBean certificateBean) {
        if (patientIdentityCardList == null) {
            patientIdentityCardList = new ArrayList<CertificatesBean>();
        }
        this.patientIdentityCardList.add(certificateBean);
    }
    public void addCard(CardsBean card) {
        if (patientMedicalCardList == null) {
            patientMedicalCardList = new ArrayList<>();
        }
        this.patientMedicalCardList.add(card);
    }

    public void addPatientCode(PatientCode patientCode) {
        if (patientIdList == null) {
            patientIdList = new ArrayList<>();
        }
        this.patientIdList.add(patientCode);
    }

    @NoArgsConstructor
    @Data
    @Builder
    @AllArgsConstructor
    @ToString
    public static class CertificatesBean {
        /**
         * cardType : 1、二代身份证2、港澳居民身份证3、台湾居民身份证4、护照
         * cardNumber : 证件号
         */

        private String cardType;
        private String cardNumber;
    }

    @NoArgsConstructor
    @Data
    @Builder
    @AllArgsConstructor
    @ToString
    public static class CardsBean {
        /**
         * cardType : 患者诊疗卡类型:1.居民健康卡 2.医院就诊卡 3.医保(社保)卡 9.其他
         * cardNo : 患者诊疗卡号码
         */

        private int patientMedicalCardType;
        private String patientMedicalCardNumber;
    }

    @NoArgsConstructor
    @Data
    @Builder
    @AllArgsConstructor
    @ToString
    public static class PatientCode{
        private String patientId; //patientId : 患者在 his 中的唯一标识
    }
}
